https://glot.io/snippets/ggfa6cz2p0/raw/main.lua